package com.linkhub.oms.data.sync.util;

import com.baomidou.mybatisplus.core.toolkit.support.SFunction;
import com.linkhub.oms.component.mp.util.QtMybatisPlusUtil;
import com.linkhub.oms.entity.OrderEntity;

/**
 * @Description: OrderQueryColumnAssist
 * @Author: echo
 * @Date: 2024/3/30 16:56
 * @Version: 1.0
 */
@SuppressWarnings("all")
public class OrderQueryColumnAssist {


    /**
     * 查询订单同步所需字段
     *
     * @return 字段
     */
    public static SFunction<OrderEntity, ?>[] queryOrderSyncColumns() {
        return QtMybatisPlusUtil.buildArray(
                OrderEntity::getId,
                OrderEntity::getSysShopId,
                OrderEntity::getSysOrderId,
                OrderEntity::getOrderNumber,
                OrderEntity::getOrderStatus,
                OrderEntity::getCustomerBusinessStatus,
                OrderEntity::getEmployeeBusinessStatus,
                OrderEntity::getSplitFlag,
                OrderEntity::getSourceOrderNumber,
                OrderEntity::getLocalization,
                OrderEntity::getDataStatus,
                OrderEntity::getCurrentTotalPrice
        );
    }

    /**
     * 查询订单状态相关字段
     *
     * @return 字段集合
     */
    public static SFunction<OrderEntity, ?>[] queryOrderStateColumns() {
        return QtMybatisPlusUtil.buildArray(
                OrderEntity::getSysShopId,
                OrderEntity::getSysOrderId,
                OrderEntity::getOrderStatus,
                OrderEntity::getCustomerBusinessStatus,
                OrderEntity::getEmployeeBusinessStatus,
                OrderEntity::getSplitFlag,
                OrderEntity::getLocalization,
                OrderEntity::getDataStatus
        );
    }

    public static SFunction<OrderEntity, ?>[] queryOrderFulfillmentColumns() {
        return QtMybatisPlusUtil.buildArray(
                OrderEntity::getSysShopId,
                OrderEntity::getSysOrderId,
                OrderEntity::getPlatFormOrderId,
                OrderEntity::getOrderNumber,
                OrderEntity::getSourceOrderNumber,
                OrderEntity::getOrderStatus,
                OrderEntity::getUpdatedAt,
                OrderEntity::getUpdatedAtConvert,
                OrderEntity::getCustomerBusinessStatus,
                OrderEntity::getEmployeeBusinessStatus,
                OrderEntity::getSplitFlag,
                OrderEntity::getLocalization,
                OrderEntity::getDataStatus
        );
    }

    public static SFunction<OrderEntity, ?>[] queryOrderForecastColumns() {
        return QtMybatisPlusUtil.buildArray(
                OrderEntity::getSysShopId,
                OrderEntity::getSysOrderId,
                OrderEntity::getOrderNumber,
                OrderEntity::getSourceOrderNumber,
                OrderEntity::getOrderStatus,
                OrderEntity::getUpdatedAt,
                OrderEntity::getUpdatedAtConvert,
                OrderEntity::getCustomerBusinessStatus,
                OrderEntity::getEmployeeBusinessStatus,
                OrderEntity::getSplitFlag,
                OrderEntity::getLocalization,
                OrderEntity::getDataStatus,
                OrderEntity::getChannelCode,
                OrderEntity::getEmail,
                OrderEntity::getWayBillNumber
        );
    }

    public static SFunction<OrderEntity, ?>[] queryOrderPrintColumns() {
        return QtMybatisPlusUtil.buildArray(
                OrderEntity::getSysShopId,
                OrderEntity::getSysOrderId,
                OrderEntity::getOrderNumber,
                OrderEntity::getOrderStatus,
                OrderEntity::getCustomerBusinessStatus,
                OrderEntity::getEmployeeBusinessStatus,
                OrderEntity::getSplitFlag,
                OrderEntity::getLocalization,
                OrderEntity::getDataStatus,
                OrderEntity::getWayBillNumber
        );
    }

    public static SFunction<OrderEntity, ?>[] queryOrderPushToWmsColumns() {
        return QtMybatisPlusUtil.buildArray(
                OrderEntity::getSysShopId,
                OrderEntity::getSysOrderId,
                OrderEntity::getOrderNumber,
                OrderEntity::getSourceOrderNumber,
                OrderEntity::getOrderStatus,
                OrderEntity::getUpdatedAt,
                OrderEntity::getUpdatedAtConvert,
                OrderEntity::getCustomerBusinessStatus,
                OrderEntity::getEmployeeBusinessStatus,
                OrderEntity::getSplitFlag,
                OrderEntity::getLocalization,
                OrderEntity::getDataStatus,
                OrderEntity::getWayBillNumber,
                OrderEntity::getWayBillPdfFile,
                OrderEntity::getPackagePdfUrl
        );
    }
}
